package ar.fiuba.logger;

/**
 * The Enum LogLevel.
 */
public enum LogLevel {
  /** The off LogLevel. */
  OFF,

  /** The fatal LogLevel. */
  FATAL,

  /** The error LogLevel. */
  ERROR,

  /** The warn LogLevel. */
  WARN,

  /** The info LogLevel. */
  INFO,

  /** The debug LogLevel. */
  DEBUG,

  /** The trace LogLevel. */
  TRACE;

  /**
   * Checks if is worse than.
   *
   * @param level the level
   * @return true, if is worse than
   */
  public boolean isWorseThan(LogLevel level) {
    return this.ordinal() < level.ordinal();
  }

  /**
   * Checks if is equal or worse than.
   *
   * @param level the level
   * @return true, if is equal or worse than
   */
  public boolean isEqualOrWorseThan(LogLevel level) {
    return this.ordinal() <= level.ordinal();
  }

  /**
   * Checks if is not worse than.
   *
   * @param level the level
   * @return true, if is not worse than
   */
  public boolean isNotWorseThan(LogLevel level) {
    return !isWorseThan(level);
  }
}
